﻿/* Open source distributed without warranties of any kind. */

namespace Transcriber.Plugins
{
    #region Using
    using System.Collections.Generic;
    using System.Xml.Serialization;
    #endregion

    /// <summary>
    /// A rule in a transcription rules XML file.
    /// </summary>
    public sealed class Rule : RulesElement
    {
        private string mPattern;
        private List<OutputNode> mNodes = new List<OutputNode>();

        /// <summary>
        /// Gets or sets the pattern to use when matching text
        /// to which to apply this rule.
        /// </summary>
        /// <value>The pattern.</value>
        [XmlAttribute("pattern")]
        public string Pattern
        {
            get { return this.mPattern; }
            set { this.mPattern = value; }
        }

        /// <summary>
        /// Gets the nodes.
        /// </summary>
        /// <value>The nodes.</value>
        [XmlElement("final", typeof(FinalOutput))]
        [XmlElement("intermediate", typeof(IntermediateResult))]
        public List<OutputNode> Nodes
        {
            get { return this.mNodes; }
        }
    }
}